<template>
  <div >
    <CityCinemaSearch> </CityCinemaSearch>
     <ul class="cinemalist">
         <li v-for="(item,index) in cinemalist" :key="index">
             <div class="info">
                 <p class="cinemaname">{{item.name}}</p>
                 <p class="address">{{item.address}}</p>
             </div>
             <div class="price">
                 {{item.lowPrice | price}} 起
             </div>
              <div >
                 {{item.Distance | distance}}  
             </div>
         </li>
     </ul>
  </div>
</template>

<script>
import CityCinemaSearch  from '@/components/CityCinemaSearch.vue'
 import {cinemaListData} from '@/api/api'

export default {
 
  props:[],
  components: {
   CityCinemaSearch
  },
  data() {
    return {
     cinemalist:''
    };
  },
  
  methods: {},
 
  computed: {},
 
  watch: {},
 
  filters: {
    price(value) {
      return parseFloat(value/100)
    },
    distance(value) {
      return value.toFixed(1) + 'km'
    }
  },
 
  beforeCreate() {},
 
  created() {
    console.log('cinema created ')
     cinemaListData(this.$store.state.cityid).then((res) => {
      console.log(res);
      this.cinemalist = res.data.data.cinemas;
      console.log("cinemalist", this.cinemalist);
    });
  },
 
  beforeMount() {},
 
  mounted() {},
 
  beforeUpdate() {},
 
  updated() {},
 
  beforeDestroy() {},
 
  destroyed() {},
}
</script>


<style  lang='scss'>
.cinemalist {
  margin-top: 24px;
  li {
    position: relative;
    background-color: #fff;
    padding: 15px;
  }
  .info {
    width: calc(100% - 65px);
    text-align: left;
    padding-right: 15px;
    p {
      display: block;
      max-width: 80%;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .cinemaname {
      color: #191a1b;
      font-size: 15px;
    }
    .address {
      color: #797d82;
      font-size: 12px;
      margin-top: 5px;
    }
  }
  .price {
    font-size: 15px;
    color: #ff5f16;
    float: right;
    margin-top: -40px;
    .rmb {
      margin-right: 5px;
    }
    .upon {
      font-size: 10px;
    }
    .postiton {
      font-weight: 400;
      display: block;
      margin-top: 5px;
      font-size: 11px;
      color: #797d82;
      text-align: center;
    }
  }
}
</style>
